<template>
	<div class="header">
		<div class="left">
			您好，欢迎访问<span>{{siteName}}城乡家园服务网</span>
		</div>
		<div v-if="!loginStatus" class="right" @click="tologin">登录/注册</div>
		<div v-if="loginStatus" class="right" @click="loginOut">退出登录</div>
	</div>
</template>

<script>
	export default {
		name: "Header",
		components: {

		},
		data() {
			return {
				loginStatus: false,
				userInfo: {},
				siteName:''
			}
		},
		mounted() {
			this.userInfo = JSON.parse(this.$getcookie("userInfo"))
			if(this.$getcookie("jy_token")!=null){
				this.loginStatus = true
			}else{
				this.loginStatus = false
			}
		},
		methods: {
			setName(name){
				this.siteName = name
			}
		}


	}
</script>

<style scoped lang="less">
	.header {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		height: 2.06rem;
		background: rgba(247, 247, 247, 1);
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 0.81rem;
		z-index: 1;

		.left {
			font-size: 0.81rem;
			font-family: PingFang SC;
			font-weight: 500;
			color: rgba(190, 190, 190, 1);

			span {
				color: #FE7700;
			}
		}

		.right {
			font-size: 0.81rem;
			font-family: PingFang SC;
			font-weight: 500;
			color: rgba(0, 0, 0, 1);
		}
	}
</style>
